export const addLocalStorage =(name:any,value:any)=>{

  console.log('addlocalstorage')

  const storage = window.localStorage;
  storage.setItem(name,value)

  // 添加事件

  let setItemEvent = new Event("setItemEvent");  // 重写注册setItem
  setItemEvent.key = name;                        
  setItemEvent.newValue = value;              
  window.dispatchEvent(setItemEvent);    

  

}

export const getLocalStorage =(name:any)=>{

  console.log('getlocal')

  const storage = window.localStorage;
  return storage.getItem(name)

}

export const removeLocalStorage =(name:any)=>{

  const storage = window.localStorage;
  return storage.removeItem(name)

}